///
/// Authorize method is called during the load phase.
///
public override void Authorize(string roles)
{
// NOTE: if role-based security was configured through Iron Speed Designer,
// and the page was configured to allow specific roles, those roles will be
// passed to this function in the roles parameter as a
// semi-colon-delimited list of values: Role1;Role2;etc.
if (("Your business logic here"))
{
this.RedirectToForbiddenPage();
}
else
{
base.Authorize(roles);
}
// Note: If your custom enforcement code must interact with the page's controls (e.g. RecordControls) after
// they have had their data loaded from the database, then you can add an event handler for one of
// the page's events (e.g. DataBinding, Load, or PreRender) which can conditionally redirect to the
// Forbidden page, Sign In page, etc.
}
|